package ihm.application;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import com.itextpdf.text.Font;
import com.jgoodies.forms.factories.Borders;

public class GratuitMenu extends JDialog implements ActionListener {
	private static final long serialVersionUID = 1L;
	private JPanel panel1;
	private JButton button3;
	private JButton button1;
	private JButton button2;
	private JButton button4;
	private JButton button5;
	private JButton button6;
	private JButton button7;
	Caisse frameParent;

	public GratuitMenu(Caisse frameParent) {
		this.frameParent = frameParent;
		initVars();
		initComponents();
		setLocationRelativeTo(null);
		setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
		pack();
		setVisible(true);
	}

	private void initVars() {
		panel1 = new JPanel();
		button3 = new JButton();
		button1 = new JButton();
		button2 = new JButton();
		button4 = new JButton();
		button5 = new JButton();
		button6 = new JButton();
		button7 = new JButton();
	}

	private void initComponents() {
		this.setLayout(new BorderLayout());

		panel1.setBorder(Borders.DLU14_BORDER);
		panel1.setLayout(new GridBagLayout());
		((GridBagLayout) panel1.getLayout()).columnWidths = new int[] { 0, 0 };
		((GridBagLayout) panel1.getLayout()).rowHeights = new int[] { 0, 0, 0,
				0, 0, 0, 0 };
		((GridBagLayout) panel1.getLayout()).columnWeights = new double[] {
				0.0, 1.0E-4 };
		((GridBagLayout) panel1.getLayout()).rowWeights = new double[] { 0.0,
				0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4 };

		button3.setText("Animateurs");
		button3.setPreferredSize(new Dimension(200, 70));
		button3.setFont(button3.getFont().deriveFont(
				button3.getFont().getStyle() | Font.BOLD,
				button3.getFont().getSize() + 5f));
		button3.addActionListener(this);
		panel1.add(button3, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
				GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
						0, 0, 5, 0), 0, 0));

		button1.setText("Concert : artistes");
		button1.setPreferredSize(new Dimension(200, 70));
		button1.setFont(button1.getFont().deriveFont(
				button1.getFont().getStyle() | Font.BOLD,
				button1.getFont().getSize() + 5f));
		button1.addActionListener(this);
		panel1.add(button1, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
				GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
						0, 0, 5, 0), 0, 0));

		button2.setText("Casse");
		button2.setPreferredSize(new Dimension(200, 70));
		button2.setFont(button2.getFont().deriveFont(
				button2.getFont().getStyle() | Font.BOLD,
				button2.getFont().getSize() + 5f));
		button2.addActionListener(this);
		panel1.add(button2, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0,
				GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
						0, 0, 5, 0), 0, 0));

		button4.setText("Autre");
		button4.setPreferredSize(new Dimension(200, 70));
		button4.setFont(button4.getFont().deriveFont(
				button4.getFont().getStyle() | Font.BOLD,
				button4.getFont().getSize() + 5f));
		button4.addActionListener(this);
		panel1.add(button4, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0,
				GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
						0, 0, 5, 0), 0, 0));

		button5.setText("1\u20ac Kicker");
		button5.setPreferredSize(new Dimension(200, 70));
		button5.setFont(button5.getFont().deriveFont(
				button5.getFont().getStyle() | Font.BOLD,
				button5.getFont().getSize() + 5f));
		button5.addActionListener(this);
		panel1.add(button5, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0,
				GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
						0, 0, 5, 0), 0, 0));

		button6.setText("1\u20ac Billard");
		button6.setPreferredSize(new Dimension(200, 70));
		button6.setFont(button6.getFont().deriveFont(
				button6.getFont().getStyle() | Font.BOLD,
				button6.getFont().getSize() + 5f));
		button6.addActionListener(this);
		panel1.add(button6, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0,
				GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
						0, 0, 0, 0), 0, 0));

		button7.setText("Annuler");
		button7.setPreferredSize(new Dimension(200, 70));
		button7.setFont(button7.getFont().deriveFont(
				button7.getFont().getStyle() | Font.BOLD,
				button7.getFont().getSize() + 5f));
		button7.addActionListener(this);
		panel1.add(button7, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0,
				GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(
						0, 0, 0, 0), 0, 0));

		this.add(panel1, BorderLayout.CENTER);
	}

	public void actionPerformed(ActionEvent e) {
		if (e.getSource() == button7) {
			this.dispose();
		}
		if (e.getSource() == button1) {

		}
		if (e.getSource() == button2) {

		}
		if (e.getSource() == button3) {

		}
		if (e.getSource() == button4) {

		}
		if (e.getSource() == button5) {

		}
		if (e.getSource() == button6) {

		}
	}
}
